home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 9 / Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO / 015a / ben311.zip / !BENDEMO.EXE / BENDEMO.BAT next >
DOS Batch File  |  1993-05-15  |  11KB  |  214 lines

  1. @Echo Off
  2.  
  3. :BENDEMO.BAT - A Demo Batch File That Demonstrates BEN
  4. :(C) 1993 by Simvis Soft
  5. :All Rights Reserved
  6.  
  7. :This batch file requires BENDEMO.DA1 through BENDEMO.DA5
  8. :to function properly. Also, ANSI.SYS should by installed.
  9. :Otherwise, some minor color errors will occur.
  10.  
  11. BEN Savepath
  12. BEN T BENDEMO.DA1
  13. If Errorlevel 2 Goto CloseDown
  14. If "%BEN%"=="" Set BEN=Nameless
  15. Set NAME=%BEN%
  16.  
  17. :MainMenu
  18. BEN Flush / MenuF BENDEMO.MNU
  19. If Errorlevel 8 Goto CloseDown
  20. If Errorlevel 7 Goto VideoMode
  21. If Errorlevel 6 Goto ScrollingAround
  22. If Errorlevel 5 Goto SoundAndMusic
  23. If Errorlevel 4 Goto UserInput
  24. If Errorlevel 3 Goto EnhancedEcho
  25. If Errorlevel 2 Goto BoxesEveryWhere
  26. If Errorlevel 1 Goto DirectoryAndFiles
  27. Goto CloseDown
  28. :----------------------------------------------------------------------------
  29. :DirectoryAndFiles
  30. BEN Cls LightGray / ShadFilledBox 6 3 75 23 Brown Green 2
  31. BEN Locate 1 9 / WriteC White Green %NAME%,~you~can~now~produce~batch~files
  32. BEN WriteC White Green with~high~degree~of~control~over~directories~and~files!
  33. BEN Locate 1 12 / WriteC LightCyan Green Just~try~our~directory~dialog~box~first!
  34. BEN Locate 1 14 / WriteC Blue Green Please~enter~a~pathname~(Eg.~C:\TELECOM\MODEM):
  35. BEN Box 19 16 58 16 Black LightGray 0 / Color Black LightGray
  36. BEN Locate 20 16 / Cursor Full / Flush / GetLine / Cursor Off
  37. If "%BEN%"=="" Set BEN=.
  38. BEN DirDisp %BEN%
  39. If "%BEN%"=="" Goto SelectFileNot
  40.  
  41. :ReturnFromSelectFileNot
  42. Set SELECT=%BEN%
  43. BEN Cls LightGray / TitledBox 6 3 75 23 White Blue 1 With~BEN,~it's~easy~to~break~a~full~filename~into~its~components:
  44. BEN Locate 25 10 / Write LightGray Blue Full~Filename:~; Write White Blue %SELECT%
  45. BEN Extract %SELECT% D
  46. BEN Locate 25 11 / Write LightGray Blue Drive:~~~~~~~~~; / Write White Blue %BEN%
  47. BEN Extract %SELECT% P\
  48. BEN Locate 25 12 / Write LightGray Blue Path:~~~~~~~~~~; / Write White Blue %BEN%
  49. BEN Extract %SELECT% N
  50. BEN Locate 25 13 / Write LightGray Blue Name:~~~~~~~~~~; / Write White Blue %BEN%
  51. BEN Extract %SELECT% E
  52. If "%BEN%"=="" Set BEN= 
  53. BEN Locate 25 14 / Write LightGray Blue Extension:~~~~~; / Write White Blue %BEN%
  54. BEN Extract %SELECT% N.E
  55. BEN Locate 25 15 / Write LightGray Blue Filename:~~~~~~; / Write White Blue %BEN%
  56. BEN GetCD
  57. BEN Locate 1 21 / WriteC Yellow Blue By~the~way,~you~are~currently~in~%BEN%!
  58. BEN Locate 1 22 / WriteC Cyan LightBlue Please~press~any~key~to~continue~.~.~. / Flush / PAUSE
  59. BEN Message Now~you~are~going~to~examine~our~file browsing~capability.~Press~ENTER and~you~will~see~BENDEMO.BAT.
  60. BEN List BENDEMO.BAT BENDEMO.BAT,~the~batch~file~you~are~running:
  61. BEN Message Isn't~that~great?~Now~try~to~zoom, move~and~size~the~browsing~window!
  62. BEN List BENDEMO.DA1 Try~to~zoom,~move~and~size~the~window~with~F5,~CTRL-F5~and~ALT-F5!
  63. BEN Message What~you~have~seen~was~just~a~small part~of~BEN.~Go~ahead~and~select other~parts~of~the~demo!
  64. Goto MainMenu
  65.  
  66. :SelectFileNot
  67. BEN Message You~left~without~selecting~any~file. Let's~assume~that~you~have~selected ~~~~~~~"C:\DOS\DISKCOPY.COM"
  68. Set BEN=C:\DOS\DISKCOPY.COM
  69. Goto ReturnFromSelectFileNot
  70. :----------------------------------------------------------------------------
  71. :BoxesEveryWhere
  72. BEN GrowFilledBox 1 1 80 25 LightGray Blue 0 / Locate 1 12
  73. BEN WriteC White Blue With~BEN,~you~can~produce~many~kinds~of~neat~boxes~in~batch~files. / Locate 1 14
  74. BEN WriteC Yellow Blue Just~sit~back~and~enjoy~the~boxing~show. / Delay 5000 / Cls LightGray
  75. BEN GrowFilledBox 1 25 80 25 Blue Blue 0 / Box 5 5 50 23 Green Blue 1 / Locate 1 25 / WriteC Yellow Blue Normal~Box;
  76. BEN Delay 3000 / FilledBox 7 7 60 20 LightGray Brown 2 / Locate 1 25 / WriteC Yellow Blue Filled~Box;
  77. BEN Delay 3000 / Box 3 3 79 10 Black Green 251 / Locate 1 25 / WriteC Yellow Blue ASCII~Bordered~Box;
  78. BEN Delay 3000 / TransparentBox 10 3 40 15 Cyan Magenta / Locate 1 25 / WriteC Yellow Blue ~~Transparent~Box~~;
  79. BEN Delay 3000 / ShadFilledBox 15 5 75 21 LightGray Red 5 / Locate 1 25 / WriteC Yellow Blue ~~Shadowed~Box~~;
  80. BEN Delay 3000 / GrowFilledBox 32 2 60 17 Blue Cyan 0 / Locate 1 25 / WriteC Yellow Blue ~Growing~Box~;
  81. BEN Delay 3000 / TitledBox 3 3 78 22 Yellow Red 1 Welcome~to~BENDEMO,~%NAME%!
  82. BEN Locate 1 25 / WriteC Yellow Blue ~Titled~Box~;
  83. BEN Delay 3000 / Message ~~~~And~Message~Box,~of~course! Press~ENTER~to~return~to~Main~Menu!
  84. Goto MainMenu
  85. :----------------------------------------------------------------------------
  86. :EnhancedEcho
  87. BEN Cls Black / Locate 1 13 / WriteC LightGray Black Why~settle~for~the~plain~gray~on~black~Echo~command?;
  88. BEN Cursor On / Delay 3000 / Cursor Off / Cls Cyan / GrowFilledBox 5 3 76 23 Blue Blue 0
  89. BEN WriteV 77 5 DARKGray Black B~E~N~~~B~E~N~~~B~E
  90. BEN Locate 28 4  / Write White Blue When~you~can~have~this:
  91. BEN Locate 25 6  / Write LightMagenta Blue Hello   / Sound 50 50
  92. BEN Locate 28 8  / Write Green Blue user!          / Sound 100 100
  93. BEN Locate 31 10 / Write Red Blue Welcome          / Sound 75 100
  94. BEN Locate 34 12 / Write LightGreen Blue to        / Sound 50 100
  95. BEN Locate 37 14 / Write Yellow Blue BEN,          / Sound 80 100
  96. BEN Locate 40 16 / Write LightCyan Blue the        / Sound 60 100
  97. BEN Locate 43 18 / Write LightMagenta Blue Batch   / Sound 100 100
  98. BEN Locate 45 20 / Write LightGreen Blue ENhancer! / Sound 75 100
  99. BEN Locate 1 22  / WriteC White LightBlue Press~Any~Key~to~Continue~.~.~. / Flush / PAUSE
  100. Goto MainMenu
  101. :----------------------------------------------------------------------------
  102. :UserInput
  103. BEN Cls Red GrowFilledBox 5 3 76 23 White Magenta 1
  104. BEN Locate 1 10 / WriteC White Magenta BEN~is~very~good~with~dealing~with~user~input.
  105. BEN Locate 1 12 / WriteC Yellow Magenta The~menu~that~brought~you~here~is~itself~a~fine~example.
  106. BEN ShadFilledBox 10 15 71 19 Blue Blue 0
  107. BEN Color Black LightGray / Locate 1 16 / WriteC White Blue Please~enter~your~favourite~color,~%NAME%
  108.  
  109. :GetFColor
  110. BEN Box 30 18 50 18 Black LightGray 0 / Locate 31 18 / Cursor Full / Flush / GetLineL / Cursor Off / Sound 50 50
  111. If "%BEN%"=="" Goto FColorEnteredNot
  112. Set FColor=%BEN%
  113. BEN Color LightGray Black / Locate 1 16 / WriteC Yellow Blue ~Now,~enter~your~favourite~animal,~%NAME%~
  114.  
  115. :GetFAnimal
  116. BEN Box 30 18 50 18 LightGray Black 0 / Locate 31 18 / Cursor Full / Flush / GetLineL / Cursor Off / Sound 50 50
  117. If "%BEN%"=="" Goto FAnimalEnteredNot
  118. BEN GrowFilledBox 10 5 71 21 Cyan Cyan 0 / Locate 1 7 / WriteC Black Cyan We~have~a~conclusion:
  119. BEN Locate 1 13 / WriteC Red Cyan "%NAME%~loves~to~eat~%FColor%~%BEN%!"
  120. BEN Locate 1 18 / WriteC Blue LightCyan Ha!~Ha!~Ha!
  121. BEN Locate 1 20 / WriteC Magenta Cyan Please~press~any~key~to~go~on~with~our~demo~.~.~. / Flush / PAUSE
  122.  
  123. Set FColor=
  124. BEN ShadFilledBox 1 1 80 25 LightCyan Red 5 / GrowFilledBox 10 8 70 14 Brown Brown 0
  125. BEN Locate 1 9 / WriteC Yellow Brown Now,~press~any~number~key~to~test~
  126. BEN WriteC Yellow Brown BEN's~key~handling~capability.
  127. BEN WriteC White Brown (Press~'Q'~to~quit)
  128. BEN Locate 1 13 / WriteC LightCyan Brown (BEN~will~reject~all~other~keys)
  129.  
  130. :AskLoop
  131. BEN ASK 1234567890Q
  132. If Errorlevel 11 Goto MainMenu
  133. If Errorlevel 10 If Not Errorlevel 11 Set BEN=0
  134. If Errorlevel 9 If Not Errorlevel 10 Set BEN=9
  135. If Errorlevel 8 If Not Errorlevel 9 Set BEN=8
  136. If Errorlevel 7 If Not Errorlevel 8 Set BEN=7
  137. If Errorlevel 6 If Not Errorlevel 7 Set BEN=6
  138. If Errorlevel 5 If Not Errorlevel 6 Set BEN=5
  139. If Errorlevel 4 If Not Errorlevel 5 Set BEN=4
  140. If Errorlevel 3 If Not Errorlevel 4 Set BEN=3
  141. If Errorlevel 2 If Not Errorlevel 3 Set BEN=2
  142. If Errorlevel 1 If Not Errorlevel 2 Set BEN=1
  143. BEN Sound 50 50 / Locate 1 18 / WriteC LightMagenta Red You~just~pressed~the~"%BEN%"~key!
  144. Goto AskLoop
  145.  
  146. :FColorEnteredNot
  147. BEN Message Please~do~enter~something!
  148. Goto GetFColor
  149.  
  150. :FAnimalEnteredNot
  151. BEN Message Please~do~enter~something!
  152. Goto GetFAnimal
  153. :----------------------------------------------------------------------------
  154. :SoundAndMusic
  155. BEN T BENDEMO.DA2
  156. rem Draws "The Music Work Shop" background by calling BENDEMO.DA2
  157.  
  158. :MusicAskLoop
  159. BEN ASK EIBQ
  160. If Errorlevel 4 If Not Errorlevel 5 Goto MainMenu
  161. If Errorlevel 3 If Not Errorlevel 4 Goto SelectBeep
  162. If Errorlevel 2 If Not Errorlevel 3 BEN T BENDEMO.DA4
  163. If Errorlevel 1 If Not Errorlevel 2 BEN T BENDEMO.DA3
  164. Goto MusicAskLoop
  165.  
  166. :SelectBeep
  167. BEN Scroll 54 5 76 17 Right / Scroll 55 5 77 17 Right / TransparentBox 57 18 77 18 Red Red
  168. BEN Beep / Scroll 56 5 78 18 Left / Scroll 55 5 77 18 Left / TransparentBox 57 18 77 18 0 0 / TransparentBox 76 6 77 17 0 0
  169. Goto MusicAskLoop
  170. :----------------------------------------------------------------------------
  171. :ScrollingAround
  172. BEN T BENDEMO.DA5
  173. Goto MainMenu
  174. :----------------------------------------------------------------------------
  175. :VideoMode
  176. BEN GrowFilledBox 5 3 76 23 White Blue 1 / GetVIDEO
  177. BEN Locate 1 10 / WriteC White Blue Let's~see~what~kind~of~video~system~you~have.
  178. BEN Locate 1 13 / WriteC LightCyan Blue Oh!~You've~got~a~%BEN%~video~system!
  179. If "%BEN%"=="EGA" Goto EGAVGA
  180. If "%BEN%"=="VGA" Goto EGAVGA
  181. BEN Locate 1 16 / WriteC Yellow Blue Too~bad~you~don't~have~an~EGA~or~a~VGA~video~system.
  182. BEN Locate 1 17 / WriteC Yellow Blue Otherwise,~we~can~show~you~BEN's~EGAVGA~function.
  183. BEN Locate 1 22 / WriteC LightGray LightBlue Well,~please~press~any~key~to~return~to~the~menu~.~.~. / Flush / PAUSE
  184. Goto MainMenu
  185.  
  186. :EGAVGA
  187. BEN Beep Locate 1 16 / WriteC Yellow LightBlue Neat!~Press~any~key~to~switch~to~extended~line~mode~.~.~.
  188. BEN Flush / PAUSE / EGAVGA On / Cls Cyan
  189. If "%BEN%"=="EGA" BEN GrowFilledBox 5 3 76 41 White Blue 2
  190. If "%BEN%"=="VGA" BEN GrowFilledBox 5 3 76 48 White Blue 2
  191. BEN Locate 1 20 WriteC Yellow Blue ╒═════╗~╒══════╗~╒══════╗~~~~~╒═╗~╒═╗~~~~╒═╗~╒══════╗~╒══════╗
  192. BEN Locate 1 21 WriteC Yellow Blue │~╓───╜~│~╓────╜~│~╓──┐~║~~~~╒╛╓╜~│~║~~~~│~║~│~╓────╜~│~╓──┐~║
  193. BEN Locate 1 22 WriteC Yellow Blue │~╚═╗~~~│~║~╒══╗~│~╚══╛~║~~~╒╛╓╜~~└┐╚╗~~╒╛╓╜~│~║~╒══╗~│~╚══╛~║
  194. BEN Locate 1 23 WriteC Yellow Blue │~╓─╜~~~│~║~└┐~║~│~╓──┐~║~~╒╛╓╜~~~~└┐╚╗╒╛╓╜~~│~║~└┐~║~│~╓──┐~║
  195. BEN Locate 1 24 WriteC Yellow Blue │~╚═══╗~│~╚══╛~║~│~║~~│~║~╒╛╓╜~~~~~~└┐╚╛╓╜~~~│~╚══╛~║~│~║~~│~║
  196. BEN Locate 1 25 WriteC Yellow Blue └─────╜~└──────╜~└─╜~~└─╜~└─╜~~~~~~~~└──╜~~~~└──────╜~└─╜~~└─╜
  197. BEN Locate 1 35 WriteC White Blue Mode~is~currently~activated,~as~you~might~have~seen!
  198. BEN Locate 1 40 WriteC LightMagenta LightBlue Press~any~key~to~return~to~25~lines~mode.
  199. BEN Flush / PAUSE / EGAVGA Off / Cursor Off / TitledBox 1 1 80 25 White Red 1 BEN~-~the~Batch~ENhancer~(c)~1993
  200. Goto MainMenu
  201. :----------------------------------------------------------------------------
  202. :CloseDown
  203. Set NAME=
  204. BEN CleanUp
  205. Cls
  206. Echo BENDEMO.BAT - A Demo Batch File That Demonstrates BEN
  207. Echo  
  208. Echo Thank you for taking your time to evaluate our demo.
  209. Echo We hope that you would take a look at other files that
  210. Echo are included in the BEN package as well (eg. BENEDIT).
  211. Echo  
  212. Echo Thanks!
  213. Echo  
  214.